﻿#if USE_UNI_LUA
using LuaAPI = UniLua.Lua;
using RealStatePtr = UniLua.ILuaState;
using LuaCSFunction = UniLua.CSharpFunctionDelegate;
#else
using LuaAPI = XLua.LuaDLL.Lua;
using RealStatePtr = System.IntPtr;
using LuaCSFunction = XLuaBase.lua_CSFunction;
#endif

using XLua;
using System.Collections.Generic;


namespace XLua.CSObjectWrap
{
    using Utils = XLua.Utils;
    public class YoozooUIYGUIModulePoolManagerWrap 
    {
        public static void __Register(RealStatePtr L)
        {
			ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			System.Type type = typeof(Yoozoo.UI.YGUI.ModulePoolManager);
			Utils.BeginObjectRegister(type, L, translator, 0, 0, 2, 1);
			
			
			
			Utils.RegisterFunc(L, Utils.GETTER_IDX, "cacheTransform", _g_get_cacheTransform);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "m_PoolList", _g_get_m_PoolList);
            
			Utils.RegisterFunc(L, Utils.SETTER_IDX, "m_PoolList", _s_set_m_PoolList);
            
			
			Utils.EndObjectRegister(type, L, translator, null, null,
			    null, null, null);

		    Utils.BeginClassRegister(type, L, __CreateInstance, 7, 1, 0);
			Utils.RegisterFunc(L, Utils.CLS_IDX, "CreatePool", _m_CreatePool_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "GetPool", _m_GetPool_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "Release", _m_Release_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "DestroyPool", _m_DestroyPool_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "DestroyPoolAll", _m_DestroyPoolAll_xlua_st_);
            Utils.RegisterFunc(L, Utils.CLS_IDX, "OnDestroyPool", _m_OnDestroyPool_xlua_st_);
            
			
            
			Utils.RegisterFunc(L, Utils.CLS_GETTER_IDX, "instance", _g_get_instance);
            
			
			
            Utils.RegisterFunc(L, Utils.CLS_IDX, "New", __CreateInstanceNew);
			Utils.EndClassRegister(type, L, translator);
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstance(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 1)
				{
					
					var gen_ret = new Yoozoo.UI.YGUI.ModulePoolManager();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.UI.YGUI.ModulePoolManager constructor!");
            
        }

        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int __CreateInstanceNew(RealStatePtr L)
        {
            
			try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
				if(LuaAPI.lua_gettop(L) == 0)
				{
					
					var gen_ret = new Yoozoo.UI.YGUI.ModulePoolManager();
					translator.Push(L, gen_ret);
                    
					return 1;
				}
				
			}
			catch(System.Exception gen_e) {
				return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
			}
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.UI.YGUI.ModulePoolManager constructor!");
            
        }

        
		
        
		
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_CreatePool_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 2&& translator.Assignable<Yoozoo.UI.YGUI.ModulePoolItemBase>(L, 1)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2)) 
                {
                    Yoozoo.UI.YGUI.ModulePoolItemBase _prefab = (Yoozoo.UI.YGUI.ModulePoolItemBase)translator.GetObject(L, 1, typeof(Yoozoo.UI.YGUI.ModulePoolItemBase));
                    int _elementCount = LuaAPI.xlua_tointeger(L, 2);
                    
                        var gen_ret = Yoozoo.UI.YGUI.ModulePoolManager.CreatePool( _prefab, _elementCount );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 1&& translator.Assignable<Yoozoo.UI.YGUI.ModulePoolItemBase>(L, 1)) 
                {
                    Yoozoo.UI.YGUI.ModulePoolItemBase _prefab = (Yoozoo.UI.YGUI.ModulePoolItemBase)translator.GetObject(L, 1, typeof(Yoozoo.UI.YGUI.ModulePoolItemBase));
                    
                        var gen_ret = Yoozoo.UI.YGUI.ModulePoolManager.CreatePool( _prefab );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 3&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& translator.Assignable<Yoozoo.UI.YGUI.ModulePoolItemBase>(L, 2)&& LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 3)) 
                {
                    string _identify = LuaAPI.lua_tostring(L, 1);
                    Yoozoo.UI.YGUI.ModulePoolItemBase _prefab = (Yoozoo.UI.YGUI.ModulePoolItemBase)translator.GetObject(L, 2, typeof(Yoozoo.UI.YGUI.ModulePoolItemBase));
                    int _elementCount = LuaAPI.xlua_tointeger(L, 3);
                    
                        var gen_ret = Yoozoo.UI.YGUI.ModulePoolManager.CreatePool( _identify, _prefab, _elementCount );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                if(gen_param_count == 2&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)&& translator.Assignable<Yoozoo.UI.YGUI.ModulePoolItemBase>(L, 2)) 
                {
                    string _identify = LuaAPI.lua_tostring(L, 1);
                    Yoozoo.UI.YGUI.ModulePoolItemBase _prefab = (Yoozoo.UI.YGUI.ModulePoolItemBase)translator.GetObject(L, 2, typeof(Yoozoo.UI.YGUI.ModulePoolItemBase));
                    
                        var gen_ret = Yoozoo.UI.YGUI.ModulePoolManager.CreatePool( _identify, _prefab );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.UI.YGUI.ModulePoolManager.CreatePool!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetPool_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    string _identifyName = LuaAPI.lua_tostring(L, 1);
                    
                        var gen_ret = Yoozoo.UI.YGUI.ModulePoolManager.GetPool( _identifyName );
                        translator.Push(L, gen_ret);
                    
                    
                    
                    return 1;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_Release_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    string _identify = LuaAPI.lua_tostring(L, 1);
                    Yoozoo.UI.YGUI.ModulePoolItemBase _viewItem = (Yoozoo.UI.YGUI.ModulePoolItemBase)translator.GetObject(L, 2, typeof(Yoozoo.UI.YGUI.ModulePoolItemBase));
                    
                    Yoozoo.UI.YGUI.ModulePoolManager.Release( _identify, _viewItem );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_DestroyPool_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
			    int gen_param_count = LuaAPI.lua_gettop(L);
            
                if(gen_param_count == 1&& (LuaAPI.lua_isnil(L, 1) || LuaAPI.lua_type(L, 1) == LuaTypes.LUA_TSTRING)) 
                {
                    string _identify = LuaAPI.lua_tostring(L, 1);
                    
                    Yoozoo.UI.YGUI.ModulePoolManager.DestroyPool( _identify );
                    
                    
                    
                    return 0;
                }
                if(gen_param_count == 1&& translator.Assignable<Yoozoo.UI.YGUI.ModulePool>(L, 1)) 
                {
                    Yoozoo.UI.YGUI.ModulePool _pool = (Yoozoo.UI.YGUI.ModulePool)translator.GetObject(L, 1, typeof(Yoozoo.UI.YGUI.ModulePool));
                    
                    Yoozoo.UI.YGUI.ModulePoolManager.DestroyPool( _pool );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
            return LuaAPI.luaL_error(L, "invalid arguments to Yoozoo.UI.YGUI.ModulePoolManager.DestroyPool!");
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_DestroyPoolAll_xlua_st_(RealStatePtr L)
        {
		    try {
            
            
            
                
                {
                    
                    Yoozoo.UI.YGUI.ModulePoolManager.DestroyPoolAll(  );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_OnDestroyPool_xlua_st_(RealStatePtr L)
        {
		    try {
            
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
            
            
            
                
                {
                    Yoozoo.UI.YGUI.ModulePool _pool = (Yoozoo.UI.YGUI.ModulePool)translator.GetObject(L, 1, typeof(Yoozoo.UI.YGUI.ModulePool));
                    
                    Yoozoo.UI.YGUI.ModulePoolManager.OnDestroyPool( _pool );
                    
                    
                    
                    return 0;
                }
                
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            
        }
        
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_instance(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			    translator.Push(L, Yoozoo.UI.YGUI.ModulePoolManager.instance);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_cacheTransform(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.ModulePoolManager gen_to_be_invoked = (Yoozoo.UI.YGUI.ModulePoolManager)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.cacheTransform);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_m_PoolList(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.ModulePoolManager gen_to_be_invoked = (Yoozoo.UI.YGUI.ModulePoolManager)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.m_PoolList);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 1;
        }
        
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _s_set_m_PoolList(RealStatePtr L)
        {
		    try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
			
                Yoozoo.UI.YGUI.ModulePoolManager gen_to_be_invoked = (Yoozoo.UI.YGUI.ModulePoolManager)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.m_PoolList = (System.Collections.Generic.List<Yoozoo.UI.YGUI.ModulePool>)translator.GetObject(L, 2, typeof(System.Collections.Generic.List<Yoozoo.UI.YGUI.ModulePool>));
            
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, $"c# exception: {gen_e}\n{Yoozoo.Framework.Managers.LuaManager.GetTraceBack()}");
            }
            return 0;
        }
        
		
		
		
		
    }
}
